{% extends "base.html" %}

{% block content %}
    <h1 class="mb-4 text-center">发布二手物品</h1>
    <div class="row justify-content-center">
        <div class="col-md-8">
            <div class="card p-5 shadow-lg">
                <form method="POST" enctype="multipart/form-data">
                    <div class="mb-3">
                        <label for="name" class="form-label">商品名称*</label>
                        <input type="text" class="form-control" id="name" name="name" required placeholder="请输入商品名称">
                    </div>
                    <div class="mb-3">
                        <label for="price" class="form-label">价格 (¥)*</label>
                        <input type="number" step="0.01" class="form-control" id="price" name="price" required placeholder="请输入价格">
                    </div>
                    <div class="mb-3">
                        <label for="category" class="form-label">分类*</label>
                        <select class="form-control" id="category" name="category" required>
                            <option value="" disabled selected>请选择分类</option>
                            <option value="学习用品">学习用品（教材、文具等）</option>
                            <option value="生活用品">生活用品（小家电、护肤品等）</option>
                        </select>
                    </div>
                    <div class="mb-3">
                        <label for="description" class="form-label">商品描述*</label>
                        <textarea class="form-control" id="description" name="description" rows="3" required placeholder="请描述商品的新旧程度、使用情况等信息"></textarea>
                    </div>
                    <div class="mb-3">
                        <label for="contact" class="form-label">联系方式*</label>
                        <input type="text" class="form-control" id="contact" name="contact" required placeholder="请输入QQ或微信号码">
                    </div>
                    <div class="mb-3">
                        <label for="image" class="form-label">商品图片（选填）</label>
                        <input type="file" class="form-control" id="image" name="image" accept="image/*">
                        <div class="form-text">支持JPG、PNG等图片格式，建议上传清晰的实物照片</div>
                    </div>
                    <div class="text-center">
                        <button type="submit" class="btn btn-primary btn-lg px-5">发布商品</button>
                    </div>
                </form>
            </div>
        </div>
    </div>
{% endblock %}